/**
 * 
 */
package com.ydy.model;

import java.util.Calendar;
import java.util.Date;

import javax.persistence.Table;

/**
 * @author xuzhaojie
 *
 *         2019年6月3日 下午3:48:04
 */
@Table(name = "request_log")
public class RequestLog {

	private Long id;
	private String url;
	private String ip;
	private Date reqTime;
	private Long reqLong;
	private Integer year;
	private Integer month;
	private Integer day;
	private Integer hour;
	private Integer minute;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	public Date getReqTime() {
		return reqTime;
	}

	public void setReqTime(Date reqTime) {
		this.reqTime = reqTime;
	}

	public Integer getYear() {
		return year;
	}

	public void setYear(Integer year) {
		this.year = year;
	}

	public Integer getMonth() {
		return month;
	}

	public void setMonth(Integer month) {
		this.month = month;
	}

	public Integer getDay() {
		return day;
	}

	public void setDay(Integer day) {
		this.day = day;
	}

	public Integer getHour() {
		return hour;
	}

	public void setHour(Integer hour) {
		this.hour = hour;
	}

	public Integer getMinute() {
		return minute;
	}

	public void setMinute(Integer minute) {
		this.minute = minute;
	}

	public Long getReqLong() {
		return reqLong;
	}

	public void setReqLong(Long reqLong) {
		this.reqLong = reqLong;
	}

	public RequestLog() {

	}

	public RequestLog(String url, String ip, Date reqTime) {
		super();
		this.url = url;
		this.ip = ip;
		this.reqTime = reqTime;
		Calendar calendar = Calendar.getInstance();
		calendar.setTime(reqTime);
		this.year = calendar.get(Calendar.YEAR);
		this.month = calendar.get(Calendar.MONTH) + 1;
		this.day = calendar.get(Calendar.DAY_OF_MONTH);
		this.hour = calendar.get(Calendar.HOUR_OF_DAY);
		this.minute = calendar.get(Calendar.MINUTE);
	}
}
